package com.demo.helloworld.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class HelloWorldController {

    @ResponseBody
    @RequestMapping("/hello")
    public String hello(){
        return "Hello World!";
    }

    @GetMapping("/helloweb")
    public String helloweb(){
        return "success";
    }

    @GetMapping("/helloth")
    public String helloth(ModelMap modelMap){
        String val = "Hello Thymeleaf!";
        modelMap.put("hello", val);
        return "success";
    }

}
